SDK/J Authentication Package ver1.0
RICOH Confidential

jp.co.ricoh.dsdk.scard.framework.util
Class APDU

java.lang.Object
  extended byjp.co.ricoh.dsdk.scard.framework.util.APDU
Direct Known Subclasses:
RequestAPDU, ResponseAPDU

public class APDU
extends java.lang.Object

This is the class that encapsulates an APDU(Application Protocol Data Unit).


Field Summary
protected  byte[] buffer
           A buffer containing an APDU.
 
Constructor Summary
APDU()
           Constructs an APDU object that is initialized by a null buffer.
APDU(APDU apdu)
           Constructs an APDU object that is initialized by an APDU parameter.
APDU(byte[] buffer)
           Constructs an APDU object that is initialized by a buffer parameter.
 
Method Summary
 void append(byte value)
           Adds a byte value at the end of an APDU.
 void append(byte[] buffer)
           Adds a buffer at the end of an APDU..
 boolean equals(java.lang.Object arg0)
           
 byte getByte(int index)
           Obtains the value of a specified position in an APDU.
 int getLength()
           Returns the length of an APDU in the byte.
 int hashCode()
           
 void setByte(int index, byte value)
           Specifies a value to a specified position in an APDU.
 void setLength(int length)
           Changes the length of an APDU.
 byte[] toBytes()
          .
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buffer

protected byte[] buffer
A buffer containing an APDU.

Constructor Detail

APDU

public APDU()
Constructs an APDU object that is initialized by a null buffer.


APDU

public APDU(byte[] buffer)
Constructs an APDU object that is initialized by a buffer parameter.

Parameters:
buffer - a buffer initializing this object.

APDU

public APDU(APDU apdu)
Constructs an APDU object that is initialized by an APDU parameter.

Parameters:
apdu - an APDU object initializing this object.
Method Detail

getLength

public final int getLength()
Returns the length of an APDU in the byte.

Returns:
the length of the APDU.

setLength

public final void setLength(int length)
Changes the length of an APDU.

Parameters:
length - the new length of an APDU specified in the byte.

getByte

public final byte getByte(int index)
Obtains the value of a specified position in an APDU.

Parameters:
index - a position in an APDU.
Returns:
the value of the specified position.

setByte

public final void setByte(int index,
                          byte value)
Specifies a value to a specified position in an APDU.

Parameters:
index - a position in an APDU.
value - a value.

append

public final void append(byte value)
Adds a byte value at the end of an APDU.

Parameters:
value - a byte value to add.

append

public final void append(byte[] buffer)
Adds a buffer at the end of an APDU..

Parameters:
buffer - a buffer to add.

toBytes

public final byte[] toBytes()
. Obtains a copy of an APDU in a byte array.

Returns:
a byte array of the APDU.

equals

public boolean equals(java.lang.Object arg0)

hashCode

public int hashCode()

SDK/J Authentication Package ver1.0
RICOH Confidential